//
//  LSYChapter.m
//  LSYReader
//
//  Created by sam on 2018/3/23.
//  Copyright © 2018年 okwei. All rights reserved.
//
#import "LSYChapter.h"
#import "NSString+EV.h"

@implementation LSYChapter
+ (instancetype)chapter:(HTMLElement *)el book:(LSYBook *)book relativeUrl:(NSURL *)url {
    LSYChapter *chapter = [[LSYChapter alloc] init];
    chapter.chapterUrl = [book.rule getElText:el rule:book.rule.chapterUrl relativeUrl:url];
    chapter.chapterName= [book.rule getElText:el rule:book.rule.chapterName relativeUrl:url];
    chapter.bookName = book.bookName;
    chapter.ruleHost = book.rule.host;
    return chapter;
}
@end
